import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/view/Home.vue'
import EditorPage from '@/page/Editor_page.vue'

Vue.use(VueRouter)

export const routes = [
	{ path: '/', name: 'Home', component: Home },
	{ path: '/publish/:id', component: EditorPage },
	{
		path: '/404',
		component: () => import('@/page/404.vue')
	},
	{
		path: '*', // 重定向页面地址
		redirect: '/404'
	}
]

const router = new VueRouter({
	mode: 'history',
	routes
})

export default router
